﻿using System.Collections.Generic;
using System.ServiceModel;
using System.ServiceModel.Web;
using System;
using System.Linq;
using System.Runtime.Serialization;
using System.ServiceModel;
using System.ServiceModel.Web;
using System.Text;

using Cinema.BL.Interfaces.DTOs;
using System.ServiceModel.Channels;
using System.IO;

namespace Cinema.Services.Contracts
{
    [ServiceContract]
    public interface ICommonService
    {
        [OperationContract]
        IEnumerable<MovieDTO> GetMovieList();
        
        [OperationContract]
        [WebGet(UriTemplate = "Movies", ResponseFormat = WebMessageFormat.Json)]
        Stream GetAllMovies();

        [OperationContract]
        [WebGet(UriTemplate = "Movies/{id}", ResponseFormat = WebMessageFormat.Json)]
        Stream GetMovieById(string id);

        [OperationContract]
        [WebInvoke(UriTemplate = "Movies", Method = "POST", ResponseFormat = WebMessageFormat.Json, RequestFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.Bare)]
        Stream InsertMovie(MovieDTO movie);

        [OperationContract]
        [WebInvoke(UriTemplate = "Movies/{id}", Method = "DELETE", ResponseFormat = WebMessageFormat.Json, RequestFormat = WebMessageFormat.Json)]
        string DeleteMovie(string id);

        [OperationContract]
        [WebInvoke(UriTemplate = "Movies", Method = "PUT", ResponseFormat = WebMessageFormat.Json, RequestFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.Bare)]
        Stream UpdateMovie(MovieDTO movie);


        // USER
        [OperationContract]
        [WebGet(UriTemplate = "Users/{userName}", ResponseFormat = WebMessageFormat.Json)]
        Stream GetUserByUserName(string userName);


        [OperationContract]
        [WebInvoke(UriTemplate = "Users", Method = "POST", ResponseFormat = WebMessageFormat.Json, RequestFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.Bare)]
        Stream InsertUser(UserDTO user);

        [OperationContract]
        [WebInvoke(UriTemplate = "Users", Method = "PUT", ResponseFormat = WebMessageFormat.Json, RequestFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.Bare)]
        Stream UpdateUser(UserDTO user);

        //ACTOR
        [OperationContract]
        [WebGet(UriTemplate = "Actors", ResponseFormat = WebMessageFormat.Json)]
        Stream GetAllActors();
    }
}
